
var mongoose = require("mongoose")
var Schema = mongoose.Schema


var data_schema = new Schema({
    goodid: String,
    name: String,
    price: Number,
    discount: Number,
    img: String,
    type: Object
})

exports.data_model = mongoose.model("datas", data_schema)


// 用户表 
var vuser_scheam = new Schema({
    username: String,
    nickname: String,
    phone: String,
    pass: String,
    age: Number,
    email: String,
    time: Date,
    role: Number,  // 角色  0  学员  1  班主任   2 讲师  3 超管 
    avatar: String
})
exports.vuser_model = mongoose.model("vusers", vuser_scheam)


// 学科表 
var vxueke_scheam = new Schema({
    value: String,
    text: String,
})
exports.vxueke_model = mongoose.model("vxuekes", vxueke_scheam)


// 班级表 
var vbanji_scheam = new Schema({
    xueke: String,
    value: String,
    text: String,
    year: String,
    num: String,
    jiangshi: String,
    banzhuren: String
})
exports.vbanji_model = mongoose.model("vbanjis", vbanji_scheam)

//   物品管理表
var item_schema = new Schema({
    name: { type: String, required: true },
    icon: { type: String, default: '' },
    star: { type: String, default: '' },
    desc: { type: String, default: '' },
    detail: { type: String, default: '' }
})

exports.item_model = mongoose.model("items", item_schema)

var person_scheam = new Schema({
    username: String,
    nickname: String,
    phone: String,
    pass: String,
    age: Number,
    email: String,
    time: Date
})
exports.person_model = mongoose.model("presons", person_scheam)

//留言表
var comment_scheam = new Schema({
    id: String,
    author: String,
    time: Date,
    title: String,
    content: String
})
exports.comment_model = mongoose.model("comments", comment_scheam)

// 千锋系统用户表 
var qfuser_scheam = new Schema({
    account: String,
    username: String,
    nickname: String,
    phone: String,
    password: String,
    age: Number,
    email: String,
    time: Date,
    role: Number,
    avatar: String
})
exports.qfuser_model = mongoose.model("qfusers", qfuser_scheam)

//公告
var qfanno_scheam = new Schema({
    title: String,
    content: String,
    time: String,
    type: String,
    desc: String,
    author: String,
    avatar: String,
})
exports.qfanno_model = mongoose.model("qfannos", qfanno_scheam)


//react项目用户表

var ruser_scheam = new Schema({
    account: String,
    username: String,
    nickname: String,
    phone: String,
    password: String,
    age: Number,
    email: String,
    time: Date,
    role: Number,
    avatar: String
})
exports.ruser_model = mongoose.model("rusers", ruser_scheam)

//岗位表
var station_scheam = new Schema({
    num: String,
    part: String,
    name: String,
    time: Date,
    role: Number,
    desc: String,
    identity: String
})

exports.station_model = mongoose.model("stations", station_scheam)

//部门表
var part_scheam = new Schema({
    num: String,
    part: String,
    pname: String,
    time: Date,
    desc: String,
})
exports.part_model = mongoose.model("parts", part_scheam)

//reactxm公告列表
var qfannoxm_scheam = new Schema({
    title: String,
    content: String,
    time: String,
    type: String,
    desc: String,
    author: String,
    avatar: String,
})
exports.qfannoxm_model = mongoose.model("qfannoxm", qfannoxm_scheam)

//员工表
var staff_scheam = new Schema({
    account: String,
    phone: String,
    password: String,
    age: Number,
    email: String,
    time: Date,
    role: Number,
    avatar: String,
    part: String,
    post: String,
    desc: String
})
exports.staff_model = mongoose.model("staffs", staff_scheam)

